package com.liy.framework.web.rs.service;

import com.liy.framework.common.extvo.LoginInfo;
import com.liy.framework.common.extvo.ResultVO;
import com.liy.framework.common.extvo.TokenVo;
import javax.ws.rs.core.Response;
import org.jboss.resteasy.core.ResteasyContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SupportResource {
    protected static Logger log = LoggerFactory.getLogger(SupportResource.class);

    protected LoginInfo getLoginUser() {
        return ResteasyContext.getContextData(LoginInfo.class);
    }

    protected TokenVo getTokenVo() {
        return ResteasyContext.getContextData(TokenVo.class);
    }

    protected String getStationNo() {
        return "";
    }

    protected String getLoginUserId() {
        return this.getLoginUser().getId();
    }

    protected String getAuthorizationValue() {
        return this.getTokenVo().getJwt();
    }

    protected Response buildResponse(ResultVO resultVO) {
        return Response.ok(resultVO).build();
    }
}
